#例9-10使用writelines ()方法向文本文件写入内容
#写操作
list=("先易后难。","\n","循序渐进。","\n")
with open("teacher.txt",mode='a') as f3:
    f3. writelines(list)
#读操作
with open("teacher.txt",mode='r') as f4:
    for line in f4. readlines():
        line_str=line.rstrip('\n')
        print(line_str)
